Repository navigation
Conversation
…ssage signing examples
ARYA-mgc
force-pushed
the
fix/pymavlink-signing-secret-key-bytes
branch
from
October 23, 2026 10:44
a4ebc0a to
adb8085
Compare
Contributor
Author
|
Hii! @hamishwillee, could you please review the changes when you get a chance? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In
en/mavgen_python/message_signing.md, the code snippets for setting up MAVLink 2 message signing initializedsecret_keyusing:In Python 2,
chr()returned an 8-bitstr(bytes). In Python 3 (supported Python 3.5+),chr(42) * 32produces a Unicode string (str).When
secret_keyis passed tomav.signing.secret_keyorthe_connection.setup_signing(secret_key), the encoder callssign_packet()(and validator callscheck_signature()), which invokes:Because
hashlib.sha256().update()strictly requires a bytes-like object, passing astrimmediately raises:Changes
en/mavgen_python/message_signing.md(lines 29 and 88) to initializesecret_keyas abytesobject:Verification
hashlib.new("sha256").update(b'*' * 32)completes without error.prettier --check,markdownlint-cli2, andcspell(0 issues).